/*
 * @Description: 
 * @Version: 
 * @Autor: tangwc
 * @Date: 2023-04-22 16:31:12
 * @LastEditors: tangwc
 * @LastEditTime: 2023-04-30 11:08:08
 * @FilePath: \stm32-lvgl+freertos-demo\System\Inc\lcd_spi.h
 * 
 *  Copyright (c) 2023 by tangwc, All Rights Reserved. 
 */
#ifndef _LCD_SPI_H_
#define _LCD_SPI_H_

#include "stm32f4xx_hal.h"

//#define SOFT_SPI
#define HARD_SPI


#ifdef SOFT_SPI
#define LCD_SPI_CTRL    GPIOB
#define LCD_SCL_GPIO 	GPIO_PIN_9
#define LCD_SDA_GPIO 	GPIO_PIN_8


#define LCD_SCL_CLR HAL_GPIO_WritePin(GPIOB, LCD_SCL_GPIO, GPIO_PIN_RESET)
#define LCD_SCL_SET HAL_GPIO_WritePin(GPIOB, LCD_SCL_GPIO, GPIO_PIN_SET)

#define LCD_SDA_CLR HAL_GPIO_WritePin(GPIOB, LCD_SDA_GPIO, GPIO_PIN_RESET)
#define LCD_SDA_SET HAL_GPIO_WritePin(GPIOB, LCD_SDA_GPIO, GPIO_PIN_SET)

#else 
#ifdef HARD_SPI

#define LCD_SPI_CTRL    GPIOA
#define LCD_SCL_GPIO 	GPIO_PIN_5
#define LCD_SDA_GPIO 	GPIO_PIN_7

#endif
#endif

void SPIv_WriteData(uint8_t Data);
#endif
